package com.service.totalauth.enums;

import org.springframework.util.StringUtils;

/**
 * @ClassName DeviceStatus
 * @Description 设备状态
 * @Author mamingcong
 * @Date 2020/4/21 14:17
 * @Version 1.0
 */
public enum ProgrammeTypeEnum {

    normal(0, "Portal"),
    FEI_SHU(1, "FeiShu"),
    DING_DING(2,"DingDing"),
    APP(3,"APP"),
    WECHAT_CODE(4,"wechatCode"),
    QQ(6,"qq"),
    ALI(7,"zhifubao"),
    u1QY_WX_STAFF(8,"qywxStaff"),
    QY_WX_APP(9,"qywxApp");
    private Integer code;

    private String description;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    private ProgrammeTypeEnum(Integer common, String description) {
        this.code = common;
        this.description = description;
    }

    public static ProgrammeTypeEnum get(Integer common) {
        if (StringUtils.hasLength(String.valueOf(common))) {
            for (ProgrammeTypeEnum element : ProgrammeTypeEnum.values()) {
                if (element.getCode().equals(common)) {
                    return element;
                }
            }
        }
        return null;
    }
}
